package band.wukong.practice.mina.quickstart.sumup.codec;

import band.wukong.practice.mina.quickstart.sumup.message.AddMessage;
import org.apache.mina.core.buffer.IoBuffer;
import org.apache.mina.core.session.IoSession;

/**
 * Desc:
 * author: wukonggg@139.com
 */
public class AddMessageEncoder<T extends AddMessage> extends AbstractMessageEncoder<T> {
    public AddMessageEncoder() {
        super(Constants.ADD);
    }

    @Override
    protected void encodeBody(IoSession session, T message, IoBuffer ioBuffer) {
        ioBuffer.putInt(message.getValue());
    }

    public void dispose() throws Exception {
    }
}
